package com.wjp.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wjp.bean.Department;
import com.wjp.service.DepartmentService;
import com.wjp.utils.Msg;

/**
 * 处理和部门有关的请求
 * @author wjp
 *
 */
@Controller
public class DepartmentController {
	
	@Autowired
	private DepartmentService departmentService; 
	
	/**
	 * 所有部门信息
	 */
	@RequestMapping("/depts")
	@ResponseBody
	public Msg getDepts(){
		List<Department> list =departmentService.getDepts();
		return Msg.success().add("depts", list);
			
		
	}
	

}
